﻿@typeparam TItem

@foreach (var field in _fields.Keys)
{
    <div class="row">
        <div class="col-2 text-end">
            @field.Name
            @if (!field.Nullable)
            {
                <span>*</span>
            }
        </div>
        <div class="col-9">
            <AutoTableFieldComponent Entity="@Entity" ColumnAttribute="field" IsDisabled="IsDisabled"></AutoTableFieldComponent>
        </div>
    </div>
}

<div class="row" style="float: right;">
    @if (!IsDisabled)
    {
        <Button class="col-auto" Text="保存" IsOutline="@IsOutline" Color="Color.Primary"
                OnClick="ToSubmit">
        </Button>
    }
    <Button class="col-auto" Text="取消" IsOutline="@IsOutline" Color="Color.Secondary"
            OnClick="ToCancel">
    </Button>
</div>